Intelligent discovery and application of API changes for application migration

ABSTRACT

Embodiments of the present invention provide a computer-implemented method for generating an API difference description file that describes the differences between multiple API versions to assist in migrating an application program from a first version to a second version. The method includes receiving a first API description file of a first version of a web API, receiving a second API description file of a second version of the web API, generating an API difference description file that describes differences between the first and second API description files, and then updating an application program using the API difference description file.

BACKGROUND

The present disclosure relates to migration of applications in view ofnewly released versions of application program interfaces (APIs), andmore specifically, to the automated discovery of web API changes andgeneration of an API difference description (ADD) file to describe thedifference between multiple API versions.

Application programs often require access to proprietary or largedatasets, or computational functionalities. Some web services mayprovide access by providing such resources over the Internet. Serviceoriented computing standards were created to define variousimplementation aspects of web services. For example, UniversalDescription Discovery & Integration (UDDI) addresses serviceidentifiability, the simple object access protocol (SOAP) prescribes howto implement service interfaces to enable interoperability, and the webservice description language (WSDL) guarantees uniform, machine-readableservice descriptions. Concepts like identifiability, interoperability,or composability may not be universally adopted by programmers, andthus, web application programming interfaces (web APIs) descriptionsgenerally do not follow any one standard. Consequently most web servicesexpose APIs having diverse conventions with descriptions may not beeasily convertible from one standard to another. Some API managementplatforms allow API providers to publically publish their APIs. In aneffort to make APIs more understandable and easy to use by API consumers(e.g., application program developers), API providers often publish anAPI description file using API description language (DL) together withtheir published public web API to assist in migrating an applicationfrom one version to another.

Because many API providers make frequent changes to their web APIs,consumers who wish to apply a latest API version are tasked to updatetheir developed applications quite often. Presently, however, APIconsumers are required to perform a complex process to update theirapplications from a first version to a second version. The process istime consuming, labor intensive, and prone to user error.

SUMMARY

Embodiments of the present invention provide a computer-implementedmethod for generating an ADD file that describes differences betweenmultiple API versions to assist in migrating an application program froma first version to a second version. A non-limiting example of themethod includes receiving, by a system comprising one more processors, afirst API description file of a first version of a web API. The methodincludes receiving, by the system, a second API description file of asecond version of the web API. The method includes generating, by thesystem, an API difference description file that describes differencesbetween the first and second API description files. The method includesupdating, by the system, an application program using the API differencedescription file.

Embodiments of the present invention provide a system for generating anADD file that describes differences between multiple API versions toassist in migrating an application program from a first version to asecond version. The system includes one or more processors configured toperform a method. A non-limiting example of the method includesreceiving, by the system, a first API description file of a firstversion of a web API. The method includes receiving, by the system, asecond API description file of a second version of the web API. Themethod includes generating, by the system, an API difference descriptionfile that describes differences between the first and second APIdescription files. The method includes updating, by the system, anapplication program using the API difference description file.

Embodiments of the invention provide a computer program product forgenerating an ADD file that describes differences between multiple APIversions to assist in migrating an application program from a firstversion to a second version, the computer program product comprising acomputer readable storage medium having program instructions embodiedtherewith. The program instructions are executable by a systemcomprising one or more processors to cause the system to perform amethod. A non-limiting example of the method includes receiving, by thesystem, a first API description file of a first version of a web API.The method includes receiving, by the system, a second API descriptionfile of a second version of the web API. The method includes generating,by the system, an API difference description file that describesdifferences between the first and second API description files. Themethod includes updating, by the system, an application program usingthe API difference description file.

Additional technical features and benefits are realized through thetechniques of the present invention. Embodiments and aspects of theinvention are described in detail herein and are considered a part ofthe claimed subject matter. For a better understanding, refer to thedetailed description and to the drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

The specifics of the exclusive rights described herein are particularlypointed out and distinctly claimed in the claims at the conclusion ofthe specification. The foregoing and other features and advantages ofthe embodiments of the invention are apparent from the followingdetailed description taken in conjunction with the accompanying drawingsin which:

FIG. 1 depicts a cloud computing environment according to one or moreembodiments of the present invention;

FIG. 2 depicts abstraction model layers according to one or moreembodiments of the present invention;

FIG. 3 depicts an exemplary computer system capable of implementing oneor more embodiments of the present invention;

FIG. 4 depicts an exemplary system that facilitates ADD file generationand application migration in accordance with one or more embodiments ofthe present invention;

FIG. 5 depicts an exemplary first and second API description file inaccordance with one or more embodiments of the present invention;

FIG. 6 depicts an exemplary ADD file in accordance with one or moreembodiments of the present invention, in which the exemplary ADD filedescribes the differences between the exemplary first and second APIdescription files of FIG. 5;

FIG. 7 depicts a flow diagram illustrating an example methodology inaccordance with one or more embodiments of the present invention.

The diagrams depicted herein are illustrative. There can be manyvariations to the diagram or the operations described therein withoutdeparting from the spirit of the invention. For instance, the actionscan be performed in a differing order or actions can be added, deleted,or modified. Also, the term “coupled” and variations thereof describeshaving a communications path between two elements and does not imply adirect connection between the elements with no interveningelements/connections between them. All of these variations areconsidered a part of the specification.

In the accompanying figures and following detailed description of thedisclosed embodiments, the various elements illustrated in the figuresare provided with two or three digit reference numbers. With minorexceptions, the leftmost digit(s) of each reference number correspond tothe figure in which its element is first illustrated.

DETAILED DESCRIPTION

Various embodiments of the invention are described herein with referenceto the related drawings. Alternative embodiments of the invention can bedevised without departing from the scope of this invention. Variousconnections and positional relationships (e.g., over, below, adjacent,etc.) are set forth between elements in the following description and inthe drawings. These connections and/or positional relationships, unlessspecified otherwise, can be direct or indirect, and the presentinvention is not intended to be limiting in this respect. Accordingly, acoupling of entities can refer to either a direct or an indirectcoupling, and a positional relationship between entities can be a director indirect positional relationship. Moreover, the various tasks andprocess steps described herein can be incorporated into a morecomprehensive procedure or process having additional steps orfunctionality not described in detail herein.

The following definitions and abbreviations are to be used for theinterpretation of the claims and the specification. As used herein, theterms “comprises,” “comprising,” “includes,” “including,” “has,”“having,” “contains” or “containing,” or any other variation thereof,are intended to cover a non-exclusive inclusion. For example, acomposition, a mixture, process, method, article, or apparatus thatcomprises a list of elements is not necessarily limited to only thoseelements but can include other elements not expressly listed or inherentto such composition, mixture, process, method, article, or apparatus.

Additionally, the term “exemplary” is used herein to mean “serving as anexample, instance or illustration.” Any embodiment or design describedherein as “exemplary” is not necessarily to be construed as preferred oradvantageous over other embodiments or designs. The terms “at least one”and “one or more” may be understood to include any integer numbergreater than or equal to one, i.e. one, two, three, four, etc. The terms“a plurality” may be understood to include any integer number greaterthan or equal to two, i.e. two, three, four, five, etc. The term“connection” may include both an indirect “connection” and a direct“connection.”

The terms “about,” “substantially,” “approximately,” and variationsthereof, are intended to include the degree of error associated withmeasurement of the particular quantity based upon the equipmentavailable at the time of filing the application. For example, “about”can include a range of ±8% or 5%, or 2% of a given value.

For the sake of brevity, conventional techniques related to making andusing aspects of the invention may or may not be described in detailherein. In particular, various aspects of computing systems and specificcomputer programs to implement the various technical features describedherein are well known. Accordingly, in the interest of brevity, manyconventional implementation details are only mentioned briefly herein orare omitted entirely without providing the well-known system and/orprocess details.

It is to be understood that although this disclosure includes a detaileddescription on cloud computing, implementation of the teachings recitedherein are not limited to a cloud computing environment. Rather,embodiments of the present invention are capable of being implemented inconjunction with any other type of computing environment now known orlater developed.

Cloud computing is a model of service delivery for enabling convenient,on-demand network access to a shared pool of configurable computingresources (e.g., networks, network bandwidth, servers, processing,memory, storage, applications, virtual machines, and services) that canbe rapidly provisioned and released with minimal management effort orinteraction with a provider of the service. This cloud model may includeat least five characteristics, at least three service models, and atleast four deployment models.

Characteristics are as follows:

On-demand self-service: a cloud consumer can unilaterally provisioncomputing capabilities, such as server time and network storage, asneeded automatically without requiring human interaction with theservice's provider.

Broad network access: capabilities are available over a network andaccessed through standard mechanisms that promote use by heterogeneousthin or thick client platforms (e.g., mobile phones, laptops, and PDAs).

Resource pooling: the provider's computing resources are pooled to servemultiple consumers using a multi-tenant model, with different physicaland virtual resources dynamically assigned and reassigned according todemand. There is a sense of location independence in that the consumergenerally has no control or knowledge over the exact location of theprovided resources but may be able to specify location at a higher levelof abstraction (e.g., country, state, or datacenter).

Rapid elasticity: capabilities can be rapidly and elasticallyprovisioned, in some cases automatically, to quickly scale out andrapidly released to quickly scale in. To the consumer, the capabilitiesavailable for provisioning often appear to be unlimited and can bepurchased in any quantity at any time.

Measured service: cloud systems automatically control and optimizeresource use by leveraging a metering capability at some level ofabstraction appropriate to the type of service (e.g., storage,processing, bandwidth, and active user accounts). Resource usage can bemonitored, controlled, and reported, providing transparency for both theprovider and consumer of the utilized service.

Service Models are as follows:

Software as a Service (SaaS): the capability provided to the consumer isto use the provider's applications running on a cloud infrastructure.The applications are accessible from various client devices through athin client interface such as a web browser (e.g., web-based e-mail).The consumer does not manage or control the underlying cloudinfrastructure including network, servers, operating systems, storage,or even individual application capabilities, with the possible exceptionof limited user-specific application configuration settings.

Platform as a Service (PaaS): the capability provided to the consumer isto deploy onto the cloud infrastructure consumer-created or acquiredapplications created using programming languages and tools supported bythe provider. The consumer does not manage or control the underlyingcloud infrastructure including networks, servers, operating systems, orstorage, but has control over the deployed applications and possiblyapplication hosting environment configurations.

Infrastructure as a Service (IaaS): the capability provided to theconsumer is to provision processing, storage, networks, and otherfundamental computing resources where the consumer is able to deploy andrun arbitrary software, which can include operating systems andapplications. The consumer does not manage or control the underlyingcloud infrastructure but has control over operating systems; storage,deployed applications, and possibly limited control of select networkingcomponents (e.g., host firewalls).

Deployment Models are as follows:

Private cloud: the cloud infrastructure is operated solely for anorganization. It may be managed by the organization or a third party andmay exist on-premises or off-premises.

Community cloud: the cloud infrastructure is shared by severalorganizations and supports a specific community that has shared concerns(e.g., mission, security requirements, policy, and complianceconsiderations). It may be managed by the organizations or a third partyand may exist on-premises or off-premises.

Public cloud: the cloud infrastructure is made available to the generalpublic or a large industry group and is owned by an organization sellingcloud services.

Hybrid cloud: the cloud infrastructure is a composition of two or moreclouds (private, community, or public) that remain unique entities butare bound together by standardized or proprietary technology thatenables data and application portability (e.g., cloud bursting forload-balancing between clouds).

A cloud computing environment is service oriented with a focus onstatelessness, low coupling, modularity, and semantic interoperability.At the heart of cloud computing is an infrastructure that includes anetwork of interconnected nodes.

Referring now to FIG. 1, illustrative cloud computing environment 50 isdepicted. As shown, cloud computing environment 50 includes one or morecloud computing nodes 10 with which local computing devices used bycloud consumers, such as, for example, personal digital assistant (PDA)or cellular telephone 54A, desktop computer 54B, laptop computer 54C,and/or automobile computer system 54N may communicate. Nodes 10 maycommunicate with one another. They may be grouped (not shown) physicallyor virtually, in one or more networks, such as Private, Community,Public, or Hybrid clouds as described hereinabove, or a combinationthereof. This allows cloud computing environment 50 to offerinfrastructure, platforms and/or software as services for which a cloudconsumer does not need to maintain resources on a local computingdevice. It is understood that the types of computing devices 54A-N shownin FIG. 1 are intended to be illustrative only and that computing nodes10 and cloud computing environment 50 can communicate with any type ofcomputerized device over any type of network and/or network addressableconnection (e.g., using a web browser).

Referring now to FIG. 2, a set of functional abstraction layers providedby cloud computing environment 50 (FIG. 1) is shown. It should beunderstood in advance that the components, layers, and functions shownin FIG. 2 are intended to be illustrative only and embodiments of theinvention are not limited thereto. As depicted, the following layers andcorresponding functions are provided:

Hardware and software layer 60 includes hardware and softwarecomponents. Examples of hardware components include: mainframes 61; RISC(Reduced Instruction Set Computer) architecture based servers 62;servers 63; blade servers 64; storage devices 65; and networks andnetworking components 66. In some embodiments, software componentsinclude network application server software 67 and database software 68.

Virtualization layer 70 provides an abstraction layer from which thefollowing examples of virtual entities may be provided: virtual servers71; virtual storage 72; virtual networks 73, including virtual privatenetworks; virtual applications and operating systems 74; and virtualclients 75.

In one example, management layer 80 may provide the functions describedbelow. Resource provisioning 81 provides dynamic procurement ofcomputing resources and other resources that are utilized to performtasks within the cloud computing environment. Metering and Pricing 82provide cost tracking as resources are utilized within the cloudcomputing environment, and billing or invoicing for consumption of theseresources. In one example, these resources may include applicationsoftware licenses. Security provides identity verification for cloudconsumers and tasks, as well as protection for data and other resources.User portal 83 provides access to the cloud computing environment forconsumers and system administrators. Service level management 84provides cloud computing resource allocation and management such thatrequired service levels are met. Service Level Agreement (SLA) planningand fulfillment 85 provide pre-arrangement for, and procurement of,cloud computing resources for which a future requirement is anticipatedin accordance with an SLA.

Workloads layer 90 provides examples of functionality for which thecloud computing environment may be utilized. Examples of workloads andfunctions which may be provided from this layer include: mapping andnavigation 91; software development and lifecycle management 92; virtualclassroom education delivery 93; data analytics processing 94;transaction processing 95; and API description file processing 96.

Turning now to an overview of technologies that are more specificallyrelevant to aspects of the invention, as noted above, API makes iteasier for developers to use certain technologies when buildingapplications. APIs simplify the process of programming an application asAPIs abstract out the underlying implementation and only exposes objectsor actions that are needed by a developer to build an applicationprogram. Some API providers utilize API management platforms to publishtheir APIs. In order to make APIs understandable and easy to use, an APIdescription file using an API description language (DL) is usuallypublished together.

For example, in the context of the Swagger Open Source framework, afteran API developer submits their API code into Swagger, Swagger toolingcan then be used to automatically generate an Open API document based onthe submitted code itself. The Open API document is formatted in astandard description language for API usage. After deciding which API touse, application developers can start writing application code for theirapplication by using the APIs themselves. Alternatively, a more modernmethod for developers to call the API is to use a software developmentkit (SDK) or other tools, like Swagger CodeGen to generate client andserver code directly from the Open API document and then to embed thegenerated code into their applications. In this way, the developedapplication callers no longer need to build JavaBeans to describe theinput and output of API themselves. In addition, the calling process islargely simplified since the generated code provides full encapsulationto the detailed implementation like URL, http, etc.

However, the methods identified above have various technical drawbacks.When APIs are changed, such as a new version of an API is released,applications that use these APIs may encounter complex updating process.In one example, the complex updating process performed by an applicationprogram developer includes obtaining new released Open API document fromAPI management platform and then trying to obtain an understanding ofthe detailed changes from a developer portal or a readme document. Theapplication program developer would then analyze how much theirapplication would be affected by the new version of the API, and thenuse Swagger CodeGen to generate new Java code or JAR files using the newversion Open API document. Subsequently, the application programdeveloper would import the new Java code or JAR files into a project.The application program developer would then resolve compiling errorsand identify changes in parameters and functions used in the Java codeor JAR files to decide whether there is need to modify current code oradd new code to make the project work.

The process referenced above is a time consuming, error-prone, andcomplex process that increases the difficulty of version migration. Assuch, some application developers are inclined to stay in the currentversion without performing an update, which would bring largemaintenance costs to API developers over time.

Turning now to an overview of the aspects of the invention, one or moreembodiments of the invention address the above-described shortcomings ofthe prior art by providing a method that intelligently discovers thedifference between multiple released API documents and records thedifferences in the format of an a API difference description (ADD) file.The ADD file is a new type of file that is formatted as a structuralmachine-consumed data type, such as a JSON or XML for example. The ADDfile is a linked list having a plurality of nodes (i.e., differencenodes). Each node represents a difference that is detected between afirst version and a second version of an API description document. Eachdifference node includes at least four fields: a type of change field, alocation of change field, a content changed field, and a next changefield. In some embodiments of the present invention, the method includesautomatically updating an application program using the ADD file. Forexample, in some embodiments of the present invention a code generator,such as Swagger CodeGen, is utilized to generate a patch file containingsuggested code modifications to the original application program, thesuggested code modifications are generated based, at least in part, onthe ADD file. Developers can then apply the patch and review thesuggested code modifications. Upon the suggested modifications beingaccepted, the new application code may be generated based on the patchto migrate the application from a first version to a second version.

Several technical benefits may be achieved by one or more embodiments ofthe present invention. Newly generated source code (e.g., Java code,JavaBeans, Java ARchive (JAR) files, etc.) would not need to be reviewedby an application programmer prior to applying and generating a patchfile for the original application. For example, the JavaBeans or JARfiles that are generated during the process would be transparent to theapplication programmer. The application programmer would not be requiredto manually resolve compiling errors and manually modify code (e.g.,update API name in a Java Bean, update an API reference, etc.). Theapplication programmer can review a suggested modification in the patchfile via a source code manager (e.g., an Rational Team Concert (RTC)manager, etc.). The application programmer can choose whether to acceptthe recommended changes via the source code manager. If the applicationprogrammer approves the suggested modification, the application wouldthen merge the new changesets and build a new application program. Inthis way, the application program is directly updated to the new versionwith minimal user effort. If the application programmer is not satisfiedwith the provided recommendation, the application programmer may performtheir own modifications based on the patch.

Turning now to a more detailed description of aspects of the presentinvention, FIG. 3 illustrates a high-level block diagram showing anexample of a computer-based system 300 useful for implementing one ormore embodiments of the invention. Although one exemplary computersystem 300 is shown, computer system 300 includes a communication path326, which connects computer system 300 to additional systems and mayinclude one or more wide area networks (WANs) and/or local area networks(LANs) such as the internet, intranet(s), and/or wireless communicationnetwork(s). Computer system 300 and additional systems are incommunication via communication path 326, (e.g., to communicate databetween them).

Computer system 300 includes one or more processors, such as processor302. Processor 302 is connected to a communication infrastructure 304(e.g., a communications bus, cross-over bar, or network). Computersystem 300 can include a display interface 306 that forwards graphics,text, and other data from communication infrastructure 304 (or from aframe buffer not shown) for display on a display unit 308. Computersystem 300 also includes a main memory 310, preferably random accessmemory (RAM), and may also include a secondary memory 312. Secondarymemory 312 may include, for example, a hard disk drive 314 and/or aremovable storage drive 316, representing, for example, a floppy diskdrive, a magnetic tape drive, or an optical disk drive. Removablestorage drive 316 reads from and/or writes to a removable storage unit318 in a manner well known to those having ordinary skill in the art.Removable storage unit 318 represents, for example, a floppy disk, acompact disc, a magnetic tape, or an optical disk, etc. which is read byand written to by a removable storage drive 316. As will be appreciated,removable storage unit 318 includes a computer readable medium havingstored therein computer software and/or data.

In some alternative embodiments of the invention, secondary memory 312may include other similar means for allowing computer programs or otherinstructions to be loaded into the computer system. Such means mayinclude, for example, a removable storage unit 320 and an interface 322.Examples of such means may include a program package and packageinterface (such as that found in video game devices), a removable memorychip (such as an EPROM or PROM) and associated socket, and otherremovable storage units 320 and interfaces 322 which allow software anddata to be transferred from the removable storage unit 320 to computersystem 300.

Computer system 300 may also include a communications interface 324.Communications interface 324 allows software and data to be transferredbetween the computer system and external devices. Examples ofcommunications interface 324 may include a modem, a network interface(such as an Ethernet card), a communications port, or a PCM-CIA slot andcard, etc. Software and data transferred via communications interface324 are in the form of signals which may be, for example, electronic,electromagnetic, optical, or other signals capable of being received bycommunications interface 324. These signals are provided tocommunications interface 324 via communication path (i.e., channel) 326.Communication path 326 carries signals and may be implemented using wireor cable, fiber optics, a phone line, a cellular phone link, an RF link,and/or other communications channels.

In the present disclosure, the terms “computer program medium,”“computer usable medium,” and “computer readable medium” are used togenerally refer to media such as main memory 310 and secondary memory312, removable storage drive 316, and a hard disk installed in hard diskdrive 314. Computer programs (also called computer control logic) arestored in main memory 310, and/or secondary memory 312. Computerprograms may also be received via communications interface 324. Suchcomputer programs, when run, enable the computer system to perform thefeatures of the present disclosure as discussed herein. In particular,the computer programs, when run, enable processor 302 to perform thefeatures of the computer system. Accordingly, such computer programsrepresent controllers of the computer system.

Referring now to FIG. 4, an exemplary system 400 for automated creationof an API difference description and migration of an application from afirst version to a second in accordance with one or more embodiments ofthe present invention. System 400 includes a server 404 that may be incommunication with one or more other devices, including, e.g., clientdevice 402. In some embodiments of the present invention, the clientdevice 402 communicates with the server 404 via a network 406.

Server 404 includes an API difference description file engine 408(hereinafter ADD engine 408). The ADD engine 408 is configured toperform operations described herein including, for example, receiving afirst a API description file, receiving a second API description file,and generating an ADD file that records the differences between thefirst and second API description files. In some embodiments of thepresent invention, certain aspects of the ADD engine 408 are configuredto operate on the client device 402. In some embodiments of the presentinvention, certain aspects of the ADD engine 408 are configured tooperate on both the server 404 and the client device 402

In some embodiments of the present invention, server 404 furtherincludes a code generation engine 410. The code generation engine 410 isconfigured to perform operations described herein including, forexample, migrating an application program from the first version to thesecond version by updating the application program using the APIdifference description file, in which the updating includes generating acode recommendation patch. In some embodiments of the present invention,certain aspects of the code generation engine 410 are configured tooperate on the server 404 via one or more processors. In someembodiments of the present invention, certain aspects of the codegeneration engine 410 are configured to operate on the client device402. In some embodiments of the present invention, certain aspects ofthe code generation engine 410 are configured to operate on both theserver 404 and the client device 402.

Network 406 can be any suitable network, such as an IP-based network forcommunication between computer system 300 and any external device.Network 406 transmits and receives data between computer system 300 anddevices and/or systems external to computer system 300. In someembodiments of the present invention, network 406 is implemented as partof a cloud computing environment 50 and/or a component of acommunication path 326 of computer system 300. In some embodiments ofthe present invention, network 406 is a managed IP network administeredby a service provider. In some embodiments of the present invention,Network 406 is a network internal to an aircraft, such as, for example,an avionics network, etc. In some embodiments of the present invention,network 406 is implemented in a wireless fashion, e.g., using wirelessprotocols and technologies, such as WiFi, WiMax, etc. In someembodiments of the present invention, Network 406 is a wired network,e.g., an Ethernet network, an ARINC 429 network, a CAN, etc., having anywired connectivity including, e.g., an RS232 connection, R5422connection, etc. In some embodiments of the present invention, network406 is a packet-switched network such as a local area network, wide areanetwork, metropolitan area network, Internet network, or other similartype of network environment. In some embodiments of the presentinvention, network 406 is a fixed wireless network, a wireless localarea network (LAN), a wireless wide area network (WAN), a personal areanetwork (PAN), a virtual private network (VPN), intranet or othersuitable network system.

API description files, such as web API description files, define a setof possible interactions with web services. API description files areoften written in machine-understandable languages such as XML or JSON.Standardized description formats may include, for example, WebApplication Description Language (WADL), Open API, Swagger, and RESTfulAPI Modeling Language (RAML). While the formats differ in the specificinformation they encode, some fundamental parts may be common to each ofthe exemplary description languages. In some embodiments of the presentinvention, API description files specify certain resources that areexposed via hypertext transfer protocol (HTTP). In some embodiments ofthe present invention, the resources correspond to particular dataelements, or correspond to one or more specific functionalities. In someembodiments of the present invention, the resources may be identifiedwith URLs, sometimes split between parts common to all of the resources(such as, for example, URL schemes, hosts, and/or base path), and mayalso be specific to the particular resource.

In some embodiments of the present invention, an API description file,such as a web API description file, is a list of specific URLs and/orprovides a recipe for constructing URLs systematically from parameters.For instance, a service exposing a resource for each of its registeredusers could provide, using the Swagger format, an API description of theform:

{  schemes : [ “https” ],  host: “api.example.com”,  basePath : “/v1”, paths: [   “/user/fuserIDg/profile” : { . . . }, . . .  ] }Where the path element {userID} is a Swagger-specific notation for apath parameter, which may indicate that several resources can beaccessed by substituting appropriate values. In some aspects, resourcesmay be refined by appending additional query parameters.

Referring back to FIG. 4, ADD engine 408 is configured to receive afirst API description file of a first version of a web API and receive asecond API description file of a second version of the web API. In someembodiments of the present invention, the first and second APIdescription files are provided by an external API provider whopublically publishes the web API and the first and second APIdescription files. In some embodiments of the present invention, thefirst and second API description files are generated by the server 404itself rather than received from an external source.

ADD engine 408 is further configured to generate an ADD file thatrecords differences that are detected between the first and second APIdescription files. For example, in some embodiments of the presentinvention, ADD engine 408 is configured to automatically detectdifferences between multiple released Open API documents and record thedetected differences in the format of an API difference descriptionfile. Various suitable methods for detecting differences betweenmultiple API description files may be utilized. For example, in oneimplementation, a code checker tool can be used to detect differencesbetween two API description files. The code checker may compare theliteral differences between the two API documents. These detecteddifferences would then be recorded into an ADD file, in which the ADDfile is formatted in accordance with one or more embodiments of thepresent invention.

FIG. 5 depicts an example first API description file 502 and an examplesecond API description file 504 (e.g., Swagger files) that may bereceived and processed in accordance with one or more embodiments of thepresent invention. The first API description file 502 pertains to afirst version of a web API whereas the second API description file 504pertains to a second version of the web API. Differences between thefirst API description file 502 and the second API description file 504are detected by ADD engine 408. In this example, ADD engine 408 detectedthat the first API difference file has three lines of code (506 a, 506b, and 506 c) that are different from code found in the second APIDifference file. ADD engine 408 detected that the second API differencefile has three lines of code (508 a, 5068, and 508 c) that are differentfrom code found in the first API Difference file. FIG. 6

FIG. 6 depicts an example ADD file 600 that is generated in accordancewith one or more embodiments of the present invention, in which ADD filedescribes the differences between the first API description file 502 andthe second API description file 504 of FIG. 5. As noted above, ADD file600 is a linked list having a plurality of nodes (602 a, 602 b, 602 c,602 d), called difference nodes, in which each difference node includesa plurality of fields (604, 606, 608, 610). Each difference node isassociated with a particular detected difference. For example, in thecontext of the examples shown in FIGS. 4 and 5, node 602 a is associatedwith modification of the text of line 506 a to the text of line 508 a;node 602 b is associated with the addition of line 508 a; node 602 c isassociated with the deletion of line 506 c; and node 602 d is associatedwith modification of the text of line 506 b to the text of line 508 c.

Each node of the plurality of nodes include at least a type of changefield 604, a location of change field 606, a content changed field 608,and a next change field 608. The type of change field stores the changetype of the node. The change types of the nodes can be an add type, adelete type, or a modify type. For example, the type of change field 604of node 602 a and 602 d indicate that the change type of those nodes istype “M”, which stands for the modify type. The type of change field 604of node 602 b indicates that the change type of the node is type “A”,which stands for the add type. The type of change field 604 of node 602c indicates that the change type of the node is of type “D”, whichstands for the delete type.

The location of change field 606 of a particular node stores a parentpath that indicates where in the first API description file 502 thechanged content occurred. For example, if a new operation is added, thelocation of change field may be base path “/”. If a new method is addedto path “/mypath” for example, the location of change field may be“/mypath”.

The content changed field 608 of a particular node stores the raw dataof a particular difference that is detected between different versionsof the API description files. For example, in FIG. 6, the contentchanged field 608 of node 602 a indicates that line 506 a has beenmodified to recite what is shown in line 508 a. The content changedfield 608 of node 602 b indicates that line 508 b was added. The contentchanged field 608 of node 602 c indicates that line 506 c was deleted.The content changed field 608 of node 602 d indicates that line 506 bhas been modified to recite what is shown in line 508 c.

The next change field 610 of a node stores a pointer that points to anext difference node of the plurality of nodes of the linked list. Insome embodiments of the present invention, the next difference node isdetermined based on the order in which the differences were determined.In some embodiments of the present invention, the next difference nodeis a difference node which not been pointed by a preceding node, thusallowing each node of the plurality of nodes to be linked to at leastone other node of the plurality of nodes. For example, in FIG. 6, thenext change field 610 of node 602 a points to node 602 b, the nextchange field 610 of node 602 b points to node 602 c, the next changefield 610 of node 602 c points to node 602 d. The next change field 610of node 602 d can point to another difference node such as a subsequentdifference node or to an already linked difference node (e.g., pointersto 602 a, 602 b, or 602 c).

Referring back to FIG. 4, in some embodiments of the present invention,code generation engine 410 is configured to migrate an applicationprogram from the first version to the second version by updating theapplication program using the ADD file. The generation engine 410 maycomprise any suitable code generation process that is capable ofperforming the embodiments set forth herein. For example, in someembodiments of the present invention, the code generation engine 410comprises a Swagger CodeGen tool that is configured to receive the ADDfile and the second API description file as inputs and to generate newJavaBeans, Java code, and/or JAR files (hereinafter the generate code)for the second version. In some embodiments of the present invention,code generation engine 410 is further configured to generate a coderecommendation patch for the application program to change theapplication from the first version to the second version based, at leastin part, on the API change difference file and the second APIdescription file.

In some embodiments of the present invention, the code generation engine410 generates the code recommendation patch by importing the generatedcode into a project of the application program, resolving compilingerrors, and discovering changes of parameters and functions used in thegenerated code to decide whether new code is to be added or current codeis to be modified to make the project work with newly generated code.The code generation engine 410 generates a patch file that includessuggested code modifications based on the discovered changes, in whicheach suggested code modification comprises a changeset. For example, insome embodiments of the present invention, code generation engine 410packages all the changesets into a patch file together with newlygenerated code. After an application programmer obtains the patch filefrom server 404, the application programmer can import the patch fileinto their current project and decide whether to accept the changesetsin the patch. Code generation 410 and/or client device 402 thenperformers a merge process to replace the prior code with the newlygenerated code by adding the new code piece and modifying the old codepiece for the project.

For example, in the context of the Swagger Open Source Framework, if aweb API is migrated from a first version (v1) to a second version (v2),in some embodiments of the present invention, the code generation engine410 would utilize the ADD file and the API description file of v2 asinputs to generate v2 JAR files. When an application programmer grantsauthority to server 404 to access the code of their application program,the code generation engine 410 would then import the generated v2 JARfiles into the project, resolve compiling errors, and then automaticallydiscover changes of parameters and functions used in the JAR files todecide whether new code should be added to the application program orwhether current code of the application program should be modified tomake the project work with the new JAR files (i.e., v2 JAR files). Apatch file that includes suggested code modifications based on thediscovered changes would then be generated, in which each suggested codemodification comprises a changeset. In particular, the patch file wouldbe generated by packing all the changesets together with the v2 JARfiles.

The patch file would then be delivered to an application programmer via,for example, client device 402, to obtain approval from the applicationprogrammer. The application programmer can then import the patch fileinto their current project and accept the changesets provided by thepatch. Code generation 410 and/or client device 402 then performers amerge process to replace v1 JAR files with the newly created v2 JARfiles by adding new code pieces and modifying old code pieces of theproject.

In some embodiments of the present invention, client device 402 and/orserver 404 include a tool that allows the application programmer toreview the suggested modifications from the provided patch file. In someembodiments of the present invention, the tool is implemented via asource code manager, for example an RTC, which allows the applicationprogrammer to approve or reject the suggested modifications. Upon theapplication programmer approving the suggested modification, the mergeprocess would be employed to update the application program. By updatingthe application program in this way the way, the application programmeris able to directly update the application program to the new APIversion with minimal user effort. If the application programmer is notsatisfied by the provided recommendation, the application programmer maywrite new application code based on the patch and publish the code viathe tool.

Additional details of the operation of system 400 will now be describedwith reference to FIG. 7, in which FIG. 7 depicts a flow diagramillustrating a methodology 700 according to one or more embodiments ofthe present invention. At 702, a first API description file of a firstversion of a web API is received (e.g., by ADD engine 408). At 704, asecond API description file of a second version of the web API isreceived (e.g., by ADD engine 408). In some embodiments, step 702 andstep 704 occur as a single step. In some embodiments, step 702 and step704 occur as separate and distinct steps. At 706, an ADD file isgenerated that describes differences between the first and second APIdescription files (e.g., by ADD engine 408). The API differencedescription file is a linked list comprising a plurality of nodes. Eachnode of the plurality of nodes is a difference node that includes aplurality of fields, wherein the plurality of fields include a type ofchange, a location of the change, a content changed, and a next change.At 708, an application program is migrated from the first version to thesecond version by updating the application program using the ADD file(e.g., by code generation engine 410, and/or client device 402). In someembodiments of the present invention, the updating of the applicationprogram includes receiving as inputs the ADD file and the second APIdescription file, generating JAR files in the second version from theinputs, and generating a code recommendation patch for the applicationprogram to change or assist in changing the application from the firstversion to the second version (e.g., by code generation engine 410and/or client device 402). The code recommendation patch is generatedbased, at least in part, on the ADD file and the second API descriptionfile.

The present invention may be a system, a method, and/or a computerprogram product at any possible technical detail level of integration.The computer program product may include a computer readable storagemedium (or media) having computer readable program instructions thereonfor causing a processor to carry out aspects of the present invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, configuration data for integrated circuitry, oreither source code or object code written in any combination of one ormore programming languages, including an object oriented programminglanguage such as Smalltalk, C++, or the like, and procedural programminglanguages, such as the “C” programming language or similar programminglanguages. The computer readable program instructions may executeentirely on the user's computer, partly on the user's computer, as astand-alone software package, partly on the user's computer and partlyon a remote computer or entirely on the remote computer or server. Inthe latter scenario, the remote computer may be connected to the user'scomputer through any type of network, including a local area network(LAN) or a wide area network (WAN), or the connection may be made to anexternal computer (for example, through the Internet using an InternetService Provider). In some embodiments, electronic circuitry including,for example, programmable logic circuitry, field-programmable gatearrays (FPGA), or programmable logic arrays (PLA) may execute thecomputer readable program instruction by utilizing state information ofthe computer readable program instructions to personalize the electroniccircuitry, in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the blocks may occur out of theorder noted in the Figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

The descriptions of the various embodiments of the present inventionhave been presented for purposes of illustration, but are not intendedto be exhaustive or limited to the embodiments disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope and spirit of the describedembodiments. The terminology used herein was chosen to best explain theprinciples of the embodiments, the practical application or technicalimprovement over technologies found in the marketplace, or to enableothers of ordinary skill in the art to understand the embodimentsdescribed herein.

What is claimed is:
 1. A computer-implemented method comprising:receiving, by a system comprising one more processors, a firstapplication programming interface (API) description file of a firstversion of a web API; receiving, by the system, a second API descriptionfile of a second version of the web API; and generating, by the system,an API difference description file that describes differences betweenthe first and second API description files; and updating, by the system,an application program using the API difference description file;wherein the API difference description file comprises a linked listcomprising a plurality of nodes; wherein each node of the plurality ofnodes of the linked list of the API difference description file is adifference node that includes a plurality of fields; wherein theplurality of fields of each difference node of the linked list include atype of change field, a location of change field, a content changedfield, and a next change field; wherein the next change field of eachdifference node of the plurality of nodes of the linked list stores apointer that points to a next difference node of the plurality of nodesof the linked list; and wherein the next difference node is determinedbased on an order in which the differences were determined such that thenext difference node is a node of the plurality of nodes that has notbeen pointed to by a preceding node of the plurality of nodes.
 2. Thecomputer-implemented method of claim 1, wherein the plurality of fieldsfurther include a type of change field, a location of change field, anda content changed field.
 3. The computer-implemented method of claim 2,wherein the location of change field of a node of the plurality of nodesstores a parent path indicating where in the first API description filechanged content associated with the node occurred, wherein the changedcontent of the node is stored in the changed content field of the node.4. The computer-implemented method of claim 2, wherein the type ofchange field of a node of the plurality of nodes stores a change type ofthe node, wherein the change type is an add type, a delete type, or amodify type.
 5. The computer-implemented method of claim 1, whereinupdating the application program using the API difference descriptionfile includes: receiving as inputs the API change difference file andthe second API description file; generating JAR files in the secondversion from the inputs; and generating a code recommendation patch forthe application program to change the application from the first versionto the second version based at least in part on the second APIdescription file and the plurality of nodes of the linked list of theAPI change difference file.
 6. The computer-implemented method of claim5, wherein generating the code recommendation patch further includes:importing the JAR files into a project of the application program;resolving compiling errors; discovering changes of parameters andfunctions used in the JAR files to decide whether new code is to beadded or current code is to be modified; and generating a patch filethat includes suggested code modifications, the suggested codemodifications being based on the discovered changes.
 7. A systemcomprising one or more processors configured to perform a method, themethod comprising: receiving, by the system, a first applicationprogramming interface (API) description file of a first version of a webAPI; receiving, by the system, a second API description file of a secondversion of the web API; generating, by the system, an API differencedescription file that describes differences between the first and secondAPI description files; and updating, by the system, an applicationprogram using the API difference description file; wherein the APIdifference description file comprises a linked list comprising aplurality of nodes; wherein each node of the plurality of nodes of thelinked list of the API difference description file is a difference nodethat includes a plurality of fields; wherein the plurality of fields ofeach difference node of the linked list includes a next change field;wherein the next change field of each difference node of the pluralityof nodes of the linked list stores a pointer that points to a nextdifference node of the plurality of nodes of the linked list; andwherein the next difference node is determined based on an order inwhich the differences were determined such that the next difference nodeis a node of the plurality of nodes that has not been pointed to by apreceding node of the plurality of nodes.
 8. The system of claim 7,wherein the plurality of fields further includes a type of change field,a location of change field, and a content changed field.
 9. The systemof claim 8, wherein the location of change field of a node of theplurality of nodes stores a parent path indicating where in the firstAPI description file changed content associated with the node occurred,wherein the changed content of the node is stored in the changed contentfield of the node.
 10. The system of claim 8, wherein the type of changefield of a node of the plurality of nodes stores a change type of thenode, wherein the change type is an add type, a delete type, or a modifytype.
 11. The system of claim 7, wherein updating the applicationprogram using the API difference description file includes: receiving asinputs the API change difference file and the second API descriptionfile; generating JAR files in the second version from the inputs; andgenerating a code recommendation patch for the application program tochange the application from the first version to the second versionbased at least in part on the second API description file and theplurality of nodes of the linked list of the API change difference file.12. The system of claim 11, wherein generating the code recommendationpatch further includes: importing the JAR files of java into a projectof the application program; resolving compiling errors; discoveringchanges of parameters and functions used in the JAR files to decidewhether new code is to be added or current code is to be modified; andgenerating a patch file that includes suggested code modifications, thesuggest code modifications being based on the discovered changes.
 13. Acomputer program product, the computer program product comprising acomputer readable storage medium having program instructions embodiedtherewith, the program instructions executable by a system comprisingone or more processors to cause the system to perform a method, themethod comprising: receiving, by the system, a first applicationprogramming interface (API) description file of a first version of a webAPI; receiving, by the system, a second API description file of a secondversion of the web API; generating, by the system, an API differencedescription file that describes differences between the first and secondAPI description files; and updating, by the system, an applicationprogram using the API difference description file; wherein the APIdifference description file comprises a linked list comprising aplurality of nodes; wherein each node of the plurality of nodes of thelinked list of the API difference description file is a difference nodethat includes a plurality of fields; wherein the plurality of fields ofeach difference node of the linked list includes a next change field;wherein the next change field of each difference node of the pluralityof nodes of the linked list stores a pointer that points to a nextdifference node of the plurality of nodes of the linked list; andwherein the next difference node is determined based on an order inwhich the differences were determined such that the next difference nodeis a node of the plurality of nodes that has not been pointed to by apreceding node of the plurality of nodes.
 14. The computer programproduct of claim 13, wherein the plurality of fields further includes atype of change field, a location of change field, and a content changedfield.
 15. The computer program product of claim 14, wherein thelocation of change field of a node of the plurality of nodes stores aparent path indicating where in the first API description file changedcontent associated with the node occurred, wherein the changed contentof the node is stored in the changed content field of the node.
 16. Thecomputer program product of claim 14, wherein the type of change fieldof a node of the plurality of nodes stores a change type of the node,wherein the change type is an add type, a delete type, or a modify type.17. The computer program product of claim 13, wherein updating theapplication program using the API difference description file includes:receiving as inputs the API change difference file and the second APIdescription file; generating JAR files in the second version from theinputs; and generating a code recommendation patch for the applicationprogram to change the application from the first version to the secondversion based at least in part on the second API description file andthe plurality of nodes of the linked list of the API change differencefile.